#include "PlayerStart.h"
#include "Common.h"
#include "resource.h"

namespace FinalRendering
{
	namespace Plugin
	{
		RefPtr<GxRendering::UI::Image> PlayerStartDesc::logoImage;
		const wchar_t * playerStartClassName = L"PlayerStart";
		PlayerStartDesc playerStartDesc;

		PlayerStart::PlayerStart(Stream * stream)
			:PointEntity(stream)
		{
		}

		PlayerStart::PlayerStart()
		{
		}

		const wchar_t * PlayerStartDesc::ClassName()
		{
			return playerStartClassName;
		}
		IEntity * PlayerStartDesc::Create()
		{
			return new PlayerStart();
		}
		void PlayerStartDesc::Destroy(IEntity * ent)
		{
			delete ent;
		}
		IEntity * PlayerStartDesc::Create(Stream * stream)
		{
			return new PlayerStart(stream);
		}

		IEntityDesc * PlayerStartDesc::GetDesc()
		{
			return &playerStartDesc;
		}

		IEntityDesc * PlayerStart::GetDesc()
		{
			return &playerStartDesc;
		}

		void PlayerStart::InitPlugin(bool isEditor, IEngine * _engine, HMODULE module)
		{
			if (isEditor)
				PlayerStartDesc::logoImage = new GxRendering::UI::Image(&GxWinGUI::Drawing::Bitmap(IDB_ENT_PLAYERSTART,(HMODULE)module), &GxRendering::UI::Color(0,0,0,255));

		}
		void PlayerStart::DestroyPlugin()
		{
			PlayerStartDesc::logoImage = 0;
		}
		void PlayerStart::EditorDraw(IView *view)
		{
			DrawEntity(this, view, Position, PlayerStartDesc::logoImage);
		}
	}
}